import java.util.Arrays;
import java.util.Collections;

public class reverseWords {
    public String _reverseWords(String s) {
        s = s.trim();
        String[] stringArr = s.split("\\s+");
        List<String> wordList = Arrays.asList(stringArr);
        Collections.reverse(wordList);
        return String.join(" ", wordList);
    }

}
